﻿/*
 * 由SharpDevelop创建。
 * 用户： xieen
 * 日期: 2013-08-14
 * 时间: 15:19
 * 
 * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
 */
using System;
using System.Configuration;
using System.Reflection;

namespace GoF23Learning._03.Builder_Pattern
{
	/// <summary>
	/// Description of Client.
	/// </summary>
	public class Client
	{
		public void BuildCar()
		{
			Director director = new Director(new BusCarBuilder());
		 	var car =  director.Construct();
		}
		public void BuildCar1()
		{
			var assemblyName = ConfigurationManager.AppSettings["AssemblyName"];
			var buildName = ConfigurationManager.AppSettings["buildName"];
			
			Assembly assembly = Assembly.Load(assemblyName);
			
			var builder = (CarBuilder)assembly.CreateInstance(buildName);
			Director director = new Director(builder);
		 	var car =  director.Construct();
		}
	}
}
